package com.founder.chd_daily_query.entity.query;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.sql.Time;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "WIN_BID_PRICE", schema = "RBD_RESULT", catalog = "")
public class WinBidPriceEntity {
    private String purchaseSalePreceptId;
    private String purchaseSalePlanId;
    private Long winBidPrice;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    private Date createDate;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    private Date lastUpdateDate;
    private String bidId;
    private String bidUnit;
    private String supplyProvinceId;
    private String powerstationId;

    @Column(name = "PARENT_PRECEPT_ID", length = 100)
    private String parentPreceptId;

    @Column(name = "BID_CODE", length = 100)
    private String bidCode;

    public String getBidCode() {
        return bidCode;
    }

    public void setBidCode(String bidCode) {
        this.bidCode = bidCode;
    }

    public String getParentPreceptId() {
        return parentPreceptId;
    }

    public void setParentPreceptId(String parentPreceptId) {
        this.parentPreceptId = parentPreceptId;
    }

    @Id
    @Column(name = "PURCHASE_SALE_PRECEPT_ID")
    public String getPurchaseSalePreceptId() {
        return purchaseSalePreceptId;
    }

    public void setPurchaseSalePreceptId(String purchaseSalePreceptId) {
        this.purchaseSalePreceptId = purchaseSalePreceptId;
    }

    @Basic
    @Column(name = "PURCHASE_SALE_PLAN_ID")
    public String getPurchaseSalePlanId() {
        return purchaseSalePlanId;
    }

    public void setPurchaseSalePlanId(String purchaseSalePlanId) {
        this.purchaseSalePlanId = purchaseSalePlanId;
    }

    @Basic
    @Column(name = "WIN_BID_PRICE")
    public Long getWinBidPrice() {
        return winBidPrice;
    }

    public void setWinBidPrice(Long winBidPrice) {
        this.winBidPrice = winBidPrice;
    }

    @Basic
    @Column(name = "CREATE_DATE")
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "LAST_UPDATE_DATE")
    public Date getLastUpdateDate() {
        return lastUpdateDate;
    }

    public void setLastUpdateDate(Date lastUpdateDate) {
        this.lastUpdateDate = lastUpdateDate;
    }

    @Basic
    @Column(name = "BID_ID")
    public String getBidId() {
        return bidId;
    }

    public void setBidId(String bidId) {
        this.bidId = bidId;
    }

    @Basic
    @Column(name = "BID_UNIT")
    public String getBidUnit() {
        return bidUnit;
    }

    public void setBidUnit(String bidUnit) {
        this.bidUnit = bidUnit;
    }

    @Basic
    @Column(name = "SUPPLY_PROVINCE_ID")
    public String getSupplyProvinceId() {
        return supplyProvinceId;
    }

    public void setSupplyProvinceId(String supplyProvinceId) {
        this.supplyProvinceId = supplyProvinceId;
    }

    @Basic
    @Column(name = "POWERSTATION_ID")
    public String getPowerstationId() {
        return powerstationId;
    }

    public void setPowerstationId(String powerstationId) {
        this.powerstationId = powerstationId;
    }

    @Override
    public String toString() {
        return "WinBidPriceEntity{" +
                "purchaseSalePreceptId='" + purchaseSalePreceptId + '\'' +
                ", purchaseSalePlanId='" + purchaseSalePlanId + '\'' +
                ", winBidPrice=" + winBidPrice +
                ", createDate=" + createDate +
                ", lastUpdateDate=" + lastUpdateDate +
                ", bidId='" + bidId + '\'' +
                ", bidUnit='" + bidUnit + '\'' +
                ", supplyProvinceId='" + supplyProvinceId + '\'' +
                ", powerstationId='" + powerstationId + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        WinBidPriceEntity that = (WinBidPriceEntity) o;
        return Objects.equals(purchaseSalePreceptId, that.purchaseSalePreceptId) &&
                Objects.equals(purchaseSalePlanId, that.purchaseSalePlanId) &&
                Objects.equals(winBidPrice, that.winBidPrice) &&
                Objects.equals(createDate, that.createDate) &&
                Objects.equals(lastUpdateDate, that.lastUpdateDate) &&
                Objects.equals(bidId, that.bidId) &&
                Objects.equals(bidUnit, that.bidUnit) &&
                Objects.equals(supplyProvinceId, that.supplyProvinceId) &&
                Objects.equals(powerstationId, that.powerstationId);
    }

    @Override
    public int hashCode() {

        return Objects.hash(purchaseSalePreceptId, purchaseSalePlanId, winBidPrice, createDate, lastUpdateDate, bidId, bidUnit, supplyProvinceId, powerstationId);
    }
}
